Repository navigation
feat(gateway): add opt-in source-scoped protocol extras - #37
Conversation
Carry reviewed per-protocol fields outside the Chat pivot behind PROTOCOL_EXTRAS_ENABLED (default off), restore them only for providers that admit each field, and report retained versus re-emitted fields without values.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
multillm-proxy | e185390 | Oct 08 2026, 11:02 PM |
a4fe9ea
into
integrate/gateway-waves-1-3
Summary
Adds source-scoped protocol extras behind
PROTOCOL_EXTRAS_ENABLED, which defaults to false. With the flag off, strict translation, namespace handling and raw request and response bytes are unchanged. An invalid flag value also disables the feature and logs one warning without the value._multillm.protocol_extras. The extras stay outside the Chat pivot body and are restored only when the target provider explicitly admits each field:top_k;truncation: "disabled";seed,logprobs,top_logprobs.stop_sequence, Chatsystem_fingerprint, Responsesservice_tier) under the same rules._multillm.protocol_extras, and the error never echoes untrusted names or values;lossy, withretained_in_ir: trueandre_emitted: false. Reports contain fixed paths and no values.Details are in
docs/protocol-extras.md.Integration
This branch wires the strict translators (validation only) and the Flask response bridge (
translate_managed_response, plus extras in the recorded conversion report). The Wave 4 integration PR still has to make these changes inroutes/unified.py:request_to_irandrequest_from_irwith provider admission at managed request dispatch;translate_managed_request, so the namespace is validated and stripped;managed_request_reportto request diagnostics and the conversion-report endpoint.Until then, translated requests validate their extras and drop them, and same-protocol requests are forwarded exactly as they are today.
Shared registrations
PROTOCOL_EXTRAS_ENABLEDto the Container env keys.Tests
tests/test_protocol_extras.py: new. It covers:npm run test:worker: 1,318 passed.cf:migrations:check,test:deploy, free routes, client headers and thewrangler deploy --dry-runbundle all pass.tests/test_frontend_build.mjsfails locally because@tailwindcss/cliis not installed. It fails the same way on main.This is part of Wave 4. It is based on
integrate/gateway-waves-1-3, and the Wave 4 integration PR adds the README line.